Ver código fonte

made small fix with date-local

unknown 3 anos atrás
pai
commit
9d3fde89ff
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      javascript/hw.js

+ 5 - 0
javascript/hw.js

@@ -207,6 +207,10 @@ function Form(el, data, okCallback, cancelCallback) {
 			return placeholder;
 		},
 		string(key, value, handelInput) {
+			const dataTime = new Date(value);
+			if (dataTime.getDate())
+				return inputCreators.object(key, value, handelInput);
+
 			if (value === '*') {
 				return inputCreators.placeholder(
 					key,
@@ -411,6 +415,7 @@ function Form(el, data, okCallback, cancelCallback) {
 const cachedFetchStarWars = async () => {
 	const lc = await localStorage.getItem('data');
 	if (lc) return JSON.parse(lc);
+
 	const data = await fetch('https://swapi.dev/api/people/1/')
 		.then((res) => res.json())
 		.then((data) => {