1.0.0 • Published 10 days ago

@ryniaubenpm/esse-accusantium-ullam v1.0.0

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

🕉 @ryniaubenpm/esse-accusantium-ullam

💎 Install

pnpm add @ryniaubenpm/esse-accusantium-ullam

🤓 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 '@ryniaubenpm/esse-accusantium-ullam'

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 '@ryniaubenpm/esse-accusantium-ullam'

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. @ryniaubenpm/esse-accusantium-ullam: 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
keyCSSgetOwnPropertyDescriptorextensionwaapiflagObject.getPrototypeOfspawnprogressomitdescriptionfile systemairbnbmakeeventDispatchertrimEndtsoutputdeepcopyuptoobjectjoithrottletranspileurlsbytedatefantasy-landES2019internales7terminalguidArrayBufferpathoptimistdefaulttyped arrayfast-cloneauthenticationwebsitebundlerdebuggerless cssECMAScript 2023curlhelpersoffsetECMAScript 5less compilertypediterationjson-schema-validatortapejsonhttpsregular expressionsinferenceposereduceschemeaccessibility256efficientclassesconsoleassertionArray.prototype.includesreadablerm -frfseventsl10nnegative zeroRFC-6455classnamerandomclientReflect.getPrototypeOffunctionsslotfastgetterArray.prototype.flattenlistenersargvspinnersRxxtermsyntaxphonestyleeventscliprotoopensgetbundlingfull-widthtrimStartStreamsstylesheetstyled-componentstsliblogeslintconfigeast-asian-width_.extendes6pyyamlinternal slotsameValueZeroformattingvisualmetadataTypedArraystreampersistentpreserve-symlinksquerystringfolderoptimizerincludesdircallbackjsequalES6mergeless.jsgroupBybufferscssArray.prototype.findLastIndexobjhttpfunctionassertsignalssigintobjecttimeshamimmutableloggingjsonschemapipegetintrinsicastharmonymapa11yeventEmitterjsdiffES5fast-deep-clonestatusconfigurableirqdatastructurestringmimetypesES2017jwtauthrm -rftypelimit3dindicatorjestvesttranspilerwatchFilebluebirdeditorsymbolcommandgdprsliceimmerES2016cryptmomentonceIteratorentriessetfromframer__proto__spinnermacosweaksetjsdomBigUint64Array.envhasUint8ArrayavajsxUint8ClampedArraysequencewritableRxJSargumentsquotetypeerrorschemamime-dbperformanceES3bcryptUint16ArrayES2018traversedeletecolorJSON-Schemaworkspace:*breakcss lesshigher-ordercoerciblewindowsfiltertddsafeFloat64Arraygenerics6to5interruptsObject.keyswalkinganimationzeroyupunicodeexit-codewidthrapidsigtermparsewebbabel-coreawesomesaucepreprocessorreadYAMLyamlvaluereadablestreamexebabelasciiwarningWeakMaptesterfastcopyfixed-widthexitextrakoreannested cssexpressprivate dataStreamexecsidefpless mixinsshrinkwrapconsumeformsesuser-streamsHyBicurriedcharacterscolourajaxpropertysharedtoolsUint32ArrayECMAScript 7call-boundcolorsjQuerydataViewmake dirdependenciesramdagetPrototypeOfqueueMicrotasksanitizationviewinputpopmotioneslintpluginmatchJSONtrimLeftbootstrap csspostcssspectypescriptpnpm9textclassnamesfast-copylinkecmascripttypedarrayscss nestingreuseString.prototype.matchAllspeedrecursiveECMAScript 2018escapecore-jsECMAScript 6matchesforEachfsoptionObject.assignlintargparselesscsschildprocessvalidationcall-bindreactredux-toolkitinstallerarraybuffervalidatorzodstarterchaigroupopenkarmagesturespromisecollectionstylingdeepclonemobilestylescallboundlastmkdirsawaitstringifystreamsduplexbyteOffsetbusydefinePropertybufferscheme-validationruntimeECMAScript 2021dom-testing-libraryexecutablechromefigletBigInt64Arraybootstrap lessutilexpressionTypeBoxpatchcirculardotenvbyteLengthxdg-openinspectECMAScript 2017deterministicbrowserlistmrudeep-copytypedarrayjson-schemaweakmapglobcharactercreateprototypefindLastIndexlockfilestablediffObject.iscommand-linelaunchserializationpositivefindLastmkdircolumnES2015qses-shimsponyfillargumentlibphonenumberregexpRegExp.prototype.flagsSetclass-validatorinvariantmovelimitedhardlinkslrusearchpolyfillsanitizeECMAScript 2019corsvariables in cssarraysthreecensorsymlinksreact-hook-formpropes2018commanderchinesereact-hooksdatadefineuuides5multi-packagesymlinkrobustdeepAsyncIteratorloggerdescriptorshookformdragconnectcolumnssuperstructuninstallflatteninstallcompareshebangiterateeslint-pluginpluginECMAScript 3prunemiddlewaretrimletURLSearchParamsapollomodulecollection.es6Object.entrieswalkutilityrmbrowsernumberECMAScript 2020nopetypesafees-abstractlookreal-timegetoptappratelimitxdgio-tserror-handlingpushelectronserializerfetchReactiveXrequirewaitidlewatcherargstasklanguageUnderscoreextendchannelArray.prototype.flatmonorepotouchreduxreducernegativeflatMaputilitiesidwriteInt16ArrayESrequesttoStringTagdeep-clone[[Prototype]]Float32Arrayfast-deep-copygraphqlenderMappicomatchutil.inspectsignaltypanionPushfunctionalInt8ArrayMicrosoftbindnodewordwrapcompileransisymbolssetterenvlook-upstatelessObservablecjkWebSocketES2023tapcss-in-jseverytypeoftc39queryES2021valuesnativesomeloadingencryptionhandlershasOwnObservablesarktypepromisespostcss-pluginArray.prototype.flatMapwatchingpureprotocol-bufferslinuxArrayformatObject.definePropertypackagetoolkitfind-upArrayBuffer.prototype.slicenodejsautoprefixerlessworkerjapanesefastcloneratelinewrapenumerableform-validationstyleguideTypeScriptes8Promiseregular expressionlazyfullwidthtermsetImmediaterangeerrorjson-schema-validationrmdirreact animationtrimRightdomcode pointsperformantsortreact poseRegExp#flagscallcmdmochaequalityArray.prototype.filterwrapWebSocketsfindES8dataviewwhichjasminemodulesObject.fromEntriescontainssortedwhatwgurlminimalSymbol.toStringTagredactSymbolpoint-freehooksregexvalidvarString.prototype.trimassignaccessoropenermkdirpbatchparserconcatMapes-shim APIdescriptorutilsregulares2015i18nfullfindupArrayBuffer#slicecomputed-typescallbindnameFunction.prototype.nameES2020tostringtagwatchpackagesWeakSetbannerArray.prototype.containsECMAScript 2022streams2settingsemojiObjectchromiumbrowserslistlengthdebugpackage managerprivateisConcatSpreadableprefixflagsremoveStyleSheetiteratorbddshelltestInt32ArrayarrayshimformapitoSortedasyncdayjssetPrototypeOfCSSStyleDeclarationartESnextES2022hashfileReactiveExtensions-0parentspringintrinsicqueuegradients css3Array.prototype.findLasttypesreact-testing-libraryes2017javascriptdirectoryframeworksyntaxerrorECMAScript 2015structuredCloneparentstelephonewordbreakprettytakecopyconfigajvcss variablevalidatecompile lessxhrpasswordcachecodesstringifierresolvexssmatchAlldependency managertoArrayconst$.extendES7concatthroattacitObject.valuesemitjsonpath0rfc4122protobufisclonegradients csserrorassertscoreeslintconcurrencysuperagentestreergbECMAScript 2016
1.0.0

10 days ago