4.10.131 • Published 11 months ago

@diotoborg/labore-inventore-exercitationem v4.10.131

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

🕉 @diotoborg/labore-inventore-exercitationem

💎 Install

pnpm add @diotoborg/labore-inventore-exercitationem

🤓 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 '@diotoborg/labore-inventore-exercitationem'

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 '@diotoborg/labore-inventore-exercitationem'

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. @diotoborg/labore-inventore-exercitationem: 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
preserve-symlinksiam$.extendmatchAllprotobufhasOwnPropertydropbuffersquerysetslice_.extendpushmodulesObject.getPrototypeOfsymbolBigInt64ArraypopmotiongetPrototypeOfloggeroptimist-0xhrassertsdatastructurecreatecoercibleperformantoncereducerenumerablebundlingremovejestajvimportexportownextraInt16ArrayCSSMapnativeintrinsiclintparsingArraysortedRegExp#flagsbinddeepclonejsdiffcolorsfastfastifyconfigTypeBoxgetOwnPropertyDescriptorstartECMAScript 2018WeakSetRegExp.prototype.flagspropertiesPushyupfsexpresspositive@@toStringTagnegative zerobannerReactiveXwafomitstructuredClonepyyamlinstallratelimitprefixStreamswalkfixed-widthfpssymlinkArray.prototype.filterstreamwordwraphttpsappfindupObject.isprotocol-buffersArrayBuffertypedarraysresolvenegativevarsvalidateupurleventDispatcheres2017dataviewspinnersFloat64ArraycompilerglacierredirectObject.valuesspawncall-boundmapsimpledbArray.prototype.containschinesetrimEndexpressionarrayperformanceES6movejapanesecomparelink256offsettypanionroutexdg-open__proto__Rxsqspackage.jsoniterateECMAScript 2016forEachsuperstructguidtypedarrayformstrimRightgesturesfast-copyfindtyped arrayimmutableconsumeWeakMapkeytextRFC-6455asserttoobjecttoolsttyreadsetImmediatearktypefileieimportrandomserializerarraysmatchestypescriptworkerframercodesoutputshrinkwrapes-shimsreduxboundamazonrapidpersistentglobalsdependency managerjQueryclientchromeflattenwebsomeURLfilterponyfillelasticacheasciiargumentbyteLengthlinewrapkoreanglobestreewgetgenericschannelcssES2019progresstypeerrores-abstractUint32ArraydefinePropertyassignutilityavathreeoptiontypeairbnbgroupByES2016Float32Arrayinternalmetadatagetoptstreamsrmassertioncoreespreefull-widtha11yObject.keysAsyncIteratorcjkanimationflatMapworkspace:*typeofcircularnamerdsreact-hook-formastparentsURLSearchParamsawstrimLeftfindLasticonvswfECMAScript 2017monorepoES2022endpointcloudwatchaccessorurlsserializationformattingfullwidthstreams2posees2018nopefrommomentgraphqldeep-copyshimhttpES2021Object.fromEntriestermcensorlaunchreact-testing-libraryECMAScript 2023fastclonemakeUint8ArraylastprocesslrusespipetelephonehardlinksstylessharedarraybuffervaluePromisereduceicues-shim APIeslint-pluginInt8ArrayrequirestringmkdirptypesafebluebirdexecutableRxJSprivate datawhichduplextddcommand-linebyteformMicrosoftrgbunicodedom-testing-libraryweaksetphonecloneiteratorvariablesarraybufferreacteventsbusyi18nschemapicomatchtoSortedReflect.getPrototypeOfstatelessdeep-cloneflagsconcurrencyinvariantconcatinferenceproxyArray.prototype.findLasttslibenvironmentasynctypesECMAScript 2020columnshashdeterministicstoragegatewaypropertystylingdefineregularschemeesclass-validatorcurldragECMAScript 2019JSON-SchemaTypedArraybeanstalkmimeESelectronframeworktostringtagvestvpctakecall-bindwalkinginputratesnsqses7endercommandertapeArray.prototype.flatMapsortescapetraversepackagesawesomesauceobjectUnderscoreenvconvertdefaultxtermprettyregexpminimalcontainsmimetypesconcatMapdateexecWebSocketsCSSStyleDeclarationYAMLsetPrototypeOfjasminetc39tapes2016regexcore-jsInt32Arraystyleguidegetterdescriptionstyled-componentsIteratorFunction.prototype.nameequalityslotES8elbterminaldeepES5s3argparseSetgroupshelltrimStartecmascripteveryfunctionscolourreadablestreamlanguageeast-asian-widthconfigurablesidetoArraysuperagentbufferweakmapisConcatSpreadablepolyfillinstallerlengthchildvisualcharsetUint16Arraywarningbreakvalidmkdirsdomfast-deep-cloneWebSocketjoidotenvconsolestartercolumnagentcss-in-jscharacterawaitobjansistringifieridentifiersapicloudsearchwebsitesymbolsreact animationES2023includespackage managerflagwaithooksES7HyBigetglobalgetintrinsicUint8ClampedArrayESnextwhatwgwriteuuidmergeSymbolStreamiterationcryptoidlehelperautoprefixerfile systemnamesspringkeysmkdirefficientnumberregular expressionstableargvECMAScript 2022emitECMAScript 6fastcopynpmpromiseequalString.prototype.matchAllrmdirruntimecomputed-typesstringifycallbacknodejsutilitiesemrES2020deepcopypostcssthrottleparentparserlibphonenumberES2017promiseszerol10ndebugObject.entriesjsdomenvironmentsqueueMicrotaskeditorpruneeslintpluginexeviewrecursivecharactersObject.assignkarmadependenciesmime-dbObservableString.prototype.trimcacheopenstaskquoteparserangeerrorpathmapreducees8fetchlazyeventEmittercode pointsprivatejshintshamextensionjspluginopencolores2015jsonpathspeeddebuggersharedcloudformationoptimizerlimittestinguninstallthroatArrayBuffer#slicexdgebserrorReactiveExtensionsreact-hooksroutingbatchscheme-validationes5.envloadbalancingfind-upspinneremojibundlerTypeScriptspecsafecallbindfunction.lengthtesterindicatoreslintentriesmulti-packagebrowserslistES3waapirobustcheck[[Prototype]]openersyntaxerrorinternal slottrimidpatchdescriptorObjectmochaArray.prototype.flattenjavascriptcopyjsxcliStyleSheettouchtsqueuerequestio-tsBigUint64Arrayinspecthigher-orderECMAScript 3redux-toolkitproplocationdescriptorssymlinks3dArrayBuffer.prototype.slicelockfileshebangvaluessequencemake dirtypedfullquerystringwrapformathasOwnObject.definePropertyredactbddfunctionES2018utilchromiumec2commanddeletetoolkittoStringTagstyletimeapollohelpersJSONeslintconfigfigletbrowserlistprotosameValueZerolook-updynamodbrfc4122pnpm9callboundreadablefast-deep-copywidthfunctionalmobilesetterlimitedmoduleaccessibilityautoscalingmatchfast-cloneSymbol.toStringTagcloudfrontroute53ECMAScript 2015postcss-plugines6loadingsearchECMAScript 7testargsbrowserextendECMAScript 2021callwritablekinesisdayjsECMAScript 5
4.9.131

11 months ago

4.10.131

11 months ago

4.9.102

12 months ago

4.9.103

12 months ago

4.9.104

12 months ago

4.9.105

12 months ago

2.7.62

1 year ago

2.7.61

1 year ago

4.9.100

12 months ago

2.7.60

1 year ago

4.9.101

12 months ago

4.7.92

12 months ago

4.7.91

12 months ago

4.9.106

12 months ago

4.9.107

12 months ago

4.9.108

12 months ago

4.9.109

11 months ago

2.3.28

1 year ago

2.3.27

1 year ago

2.3.29

1 year ago

2.5.47

1 year ago

2.5.48

1 year ago

2.5.49

1 year ago

2.7.66

1 year ago

2.5.43

1 year ago

2.7.65

1 year ago

2.5.44

1 year ago

2.7.64

1 year ago

2.5.45

1 year ago

2.7.63

1 year ago

2.5.46

1 year ago

2.7.68

1 year ago

2.7.67

1 year ago

4.9.113

11 months ago

4.9.114

11 months ago

4.9.115

11 months ago

4.9.116

11 months ago

4.9.110

11 months ago

4.9.111

11 months ago

4.9.112

11 months ago

4.9.117

11 months ago

4.9.118

11 months ago

4.9.119

11 months ago

2.3.39

1 year ago

2.3.38

1 year ago

2.5.58

1 year ago

2.3.35

1 year ago

2.3.34

1 year ago

2.3.37

1 year ago

2.3.36

1 year ago

2.5.54

1 year ago

2.3.31

1 year ago

2.5.55

1 year ago

2.3.30

1 year ago

2.5.56

1 year ago

2.3.33

1 year ago

2.5.57

1 year ago

2.3.32

1 year ago

2.5.50

1 year ago

2.5.51

1 year ago

2.5.52

1 year ago

2.5.53

1 year ago

4.9.124

11 months ago

4.9.125

11 months ago

4.9.126

11 months ago

4.9.127

11 months ago

4.9.120

11 months ago

4.9.121

11 months ago

4.9.122

11 months ago

4.9.123

11 months ago

4.9.128

11 months ago

4.9.129

11 months ago

2.3.42

1 year ago

2.3.41

1 year ago

4.9.130

11 months ago

2.3.43

1 year ago

3.7.91

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

2.3.40

1 year ago

3.7.90

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

3.7.79

1 year ago

3.7.77

1 year ago

3.7.78

1 year ago

3.7.75

1 year ago

3.7.76

1 year ago

4.8.100

12 months ago

2.6.59

1 year ago

3.7.73

1 year ago

3.7.74

1 year ago

3.7.71

1 year ago

3.7.72

1 year ago

2.6.58

1 year ago

3.7.70

1 year ago

3.7.88

1 year ago

3.7.89

1 year ago

3.7.86

1 year ago

3.7.87

1 year ago

4.8.92

12 months ago

4.8.94

12 months ago

4.8.93

12 months ago

4.8.96

12 months ago

4.8.95

12 months ago

4.8.98

12 months ago

2.2.19

1 year ago

4.8.97

12 months ago

4.8.99

12 months ago

2.2.26

1 year ago

2.2.27

1 year ago

2.2.24

1 year ago

2.2.25

1 year ago

2.2.22

1 year ago

2.2.23

1 year ago

3.7.84

1 year ago

2.4.43

1 year ago

2.2.20

1 year ago

3.7.85

1 year ago

2.2.21

1 year ago

3.7.82

1 year ago

3.7.83

1 year ago

3.7.80

1 year ago

3.7.81

1 year ago

1.2.18

1 year ago

1.2.19

1 year ago

3.7.68

1 year ago

3.7.69

1 year ago

2.7.59

1 year ago

1.1.14

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.13

1 year ago

1.1.9

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago