1.2.1 • Published 12 days ago

@libtommy2024/quos-corporis-modi-perspiciatis v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 days ago

🕉 @libtommy2024/quos-corporis-modi-perspiciatis

💎 Install

pnpm add @libtommy2024/quos-corporis-modi-perspiciatis

🤓 Unit Tests

Statements

🙏 Description

  • First function accepts a Date object and returns a string that may be used as a value in an input that has a type of datetime-local - YYYY-MM-DDTHH:mm
  • Second function accepts a datetime-local input's value and returns a date time string format based on ISO 8601 - YYYY-MM-DDTHH:mm:ss.sssZ

💚 toInputValue()

import { toInputValue } from '@libtommy2024/quos-corporis-modi-perspiciatis'

const date = new Date((new Date()).getTime() + (3 * 60000)) // now + 3 minutes
const value = toInputValue(date)
<input bind:value={ value } type="datetime-local">
  • 🔥 Errors we may throw
if (!(date instanceof Date) || date.toString() === 'Invalid Date') throw { id: 'fln__datetime-local__invalid-date', message: 'Please pass toInputValue() a valid Date object', _errorData: { date } }

💛 toISOString()

  • Accepts a datetime-local input's value and returns a date time string format based on ISO 8601 - YYYY-MM-DDTHH:mm:ss.sssZ
  • toISOString(date: string): string
  • Example:
import { toInputValue, toISOString } from '@libtommy2024/quos-corporis-modi-perspiciatis'

const date = new Date()
date.setDate(date.getDate() - 7) // now - 7 days
const iso = toISOString(toInputValue(date)) // ready for db insert
  • 🔥 Errors we may throw
if (!date || typeof date !== 'string') throw { id: 'fln__datetime-local__empty-date', message: 'Please pass toISOString() a not empty string', _errorData: { date } }

if (date.toString() === 'Invalid Date') throw { id: 'fln__datetime-local__invalid-date', message: 'Please pass toISOString() a valid date string', _errorData: { date } }

🎁 All Our Packages

  1. @libtommy2024/quos-corporis-modi-perspiciatis: NPMGithub
  2. @feelinglovelynow/dgraph: NPMGithub
  3. @feelinglovelynow/env-write: NPMGithub
  4. @feelinglovelynow/get-form-entries: NPMGithub
  5. @feelinglovelynow/get-relative-time: NPMGithub
  6. @feelinglovelynow/global-style: NPMGithub
  7. @feelinglovelynow/jwt: NPMGithub
  8. @feelinglovelynow/loop-backwards: NPMGithub
  9. @feelinglovelynow/slug: NPMGithub
  10. @feelinglovelynow/svelte-catch: NPMGithub
  11. @feelinglovelynow/svelte-kv: NPMGithub
  12. @feelinglovelynow/svelte-loading-anchor: NPMGithub
  13. @feelinglovelynow/svelte-modal: NPMGithub
  14. @feelinglovelynow/svelte-turnstile: NPMGithub
  15. @feelinglovelynow/toast: NPMGithub
trimgetOwnPropertyDescriptorinterruptstypereact-testing-libraryObject.definePropertybootstrap lessspringnested csscolumnutil.inspectWebSocketsfolderdeep-cloneprunesetnumberelectronthreeenvironmentrecursivecall-bindreadbrowsermkdiraccessibilityArray.prototype.flatcommand-linetypanionsignalArray.prototype.findLastformsflagsrapiddeep-copysideinferencewrapreducereventDispatcherexitmatchesTypeScriptcheckdeterministicECMAScript 6flatObject.keysstartshelloptimistes2015animationspeedserializationBigInt64Arrayfastcompilerredux-toolkitserializerES2021tacitdependenciesrmclassnamescheme-validationfull-widthgetreact posesanitizationtypescripteverystylesheetcoreObject.valuesterminalmime-dbmulti-packageawesomesaucevariables in cssequalityfixed-widthHyBipackage.jsontypesvalidatecallbindtddIteratorES2020setPrototypeOfpasswordmixinsfast-cloneaccessorURLes2018xssStreamses6slotpostcss-plugingradients css3testflatMaptranspilerslicesuperstructjsdifftypesafedeleteRegExp.prototype.flagspreprocessorhandlersdatejestfast-deep-clonehasdropopensirqWebSocketbundlingconnectemojiECMAScript 7Underscoresyntaxthroatcolumnssometypeerrorloadingregular expressionspropertiesArrayBuffer#slicepackage managerbyteoperating-systemomitwarningES2018ECMAScript 3mergextermintrinsicwaapicloneclassesdefinecode pointsmkdirpschema[[Prototype]]movefast-copyencryptioncolourtapeconcatMapReactiveXfileprogresstypedarraybreakxhrtesterlintvestwebcollectionlruchaiFloat64ArrayconsumemruArrayBuffercircularmodulescompile lessdotenvlanguagemodulejsonpathreact-hook-formfantasy-land256bootstrap cssloggerurlsanitizefastifycolorwatchingdataassertionbuffersutilitieseslintschemetrimRightcoerciblerm -frregexES2015Array.prototype.flattenrequestecmascriptharmonyduplexECMAScript 2018react animationECMAScript 2017matchAllajvregexppersistentobjArray.prototype.containsPushlogsuperagentfpflag6to5mimetypestranspile3dES2016limitedhttpsgroupbundlerinstallJSONargumentsameValueZeroless csshigher-orderwidthmakeweakmapenumerablebabelcommandphonehelpersdatastructureStreamCSSpipebyteLengthcore-jsYAMLinvariant__proto__es8descriptorInt8Arraybluebirdlesscssless compilercreatestatuspopmotionMicrosoftESAsyncIteratorspinnerpromisees5getterUint32Arrayrmdirmake dirrgbdeepnegativeESnextES7Float32Arrayjwttraversemetadataxdg-openbddargumentsqueryapitextjson-schema-validatormkdirs.envnope-0ECMAScript 2019censorpluginlook-upshamwatchreal-timeshrinkwrapstringifyTypedArrayconcatspawnratees2017wordwrapcharacteres7queuecolorschromespinnerstrimStartextraloggingpatchajaxwhichidlenpmcall-boundinspectpoint-freeletdependency manageres-shimsfindupframerObservableauthenticationpicomatchiterateprettystreamsmiddlewarecompareresolvejavascripthttphookformES2017sharedarraybufferttypushES5ES2019toolsless.jsescapeworkerfastclonefind-upassertsgesturesprocessvarcallJSON-SchemanativeremoveiscryptoclassnamesupeventscontainspropertylengthReflect.getPrototypeOfUint16ArrayES3typeofspecRFC-6455isConcatSpreadablelinewraptoobjectReactiveExtensionsformattingyamlparsees-abstracttc39dataViewvalidationkeybatchECMAScript 2020filterfunctionalinstallerdom-testing-librarycallbackminimalreadablestreamBigUint64ArrayargparsefulljsxObservablescss-in-jsObject.entriesfastcopyqueueMicrotasktostringtagform-validationflattentoArraynodefindLastIndexwritelesshasOwncjkequaloptimizerimportesreduceshebangpackagezerobabel-coreratelimitprototypeargvarraysformECMAScript 2016viewindicatornamestreamrobustgetintrinsiccharactersoncefetchauth@@toStringTaggdprtslibcryptperformanceES2023cssstyled-componentsarrayhookswindowstypedarraysArrayBuffer.prototype.slicecollection.es6toStringTagtsbusywritableconstpositiveglobsymbolvariablesquerystringartawaitless mixinsjsconfigurablesigtermsyntaxerrorestreefseventsmonorepotapemitreduxparentsarktypeieclientfast-deep-copycommandertaskArraypyyamlquotesetImmediaterfc4122computed-typesarraybuffergetoptcss lesses-shim APIregular expressionmochainternalrandomcmdclilastweaksetprivate dataascii0css nestingcachedescriptionUint8ClampedArraytouchlinkdeepcloneerroruninstallchildconcurrencysettingsdebuggerObject.assigntimeprefixbannerairbnbObjectreactwebsitepnpm9descriptorslockfiledragbindbrowserslistreact-hooksFunction.prototype.namepostcssvaluesexecES8diffcallboundfromECMAScript 2015trimEndSymbolexit-codeposetelephonemobilethrottleiterationSetxdgArray.prototype.flatMapgraphqlperformantlibphonenumberstructuredClonehashdebugstringstringifierArray.prototype.includeszodrm -rfprotobufsharedparserbufferexpressionenvreadablesortlookgroupByTypeBoxECMAScript 2022walkWeakSetwatcheruuiddirectoryeslint-pluginRxtyped arraysequenceprivateString.prototype.trimstylingjsdomclass-validatorsymbolspackagesfsjapaneselistenersURLSearchParamsfunctiongradients csschineseenderiteratornamescss variablecodesl10nString.prototype.matchAllexecutableUint8ArraydataviewbyteOffsetfile systemvalidatorjsonbrowserlistRxJSfindLastmacosmatchstylecurlwordbreakpureexpressmimeeslintconfigsafeforEachInt32ArrayassignchromiumutilitysymlinksruntimemomentserializeassertoffsettypededitorrangeerrorECMAScript 2021Object.getPrototypeOfjoistreams2eventEmitterlaunch
1.2.0

12 days ago

1.2.1

12 days ago

1.0.0

1 month ago