File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/routes/tests/datetime-local Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 22 import {
33 dateProxy ,
44 intProxy ,
5+ numberProxy ,
56 superForm ,
67 superValidateSync
78 } from ' $lib/client' ;
3031 empty: ' undefined'
3132 });
3233
33- const num = intProxy (form , ' number' , {
34+ const num = numberProxy (form , ' number' , {
3435 empty: ' undefined'
3536 });
3637 </script >
4647 Name: <input name ="date" type ="datetime-local" bind:value ={$date } />
4748 {#if $errors .date }<span class ="invalid" >{$errors .date }</span >{/if }
4849 </label >
50+ <label >
51+ Number2: <input
52+ name =" number2"
53+ type =" number"
54+ bind:value ={$form .number2 }
55+ />
56+ {#if $errors .number2 }<span class ="invalid" >{$errors .number2 }</span >{/if }
57+ </label >
4958 <div >
5059 <button >Submit</button >
5160 </div >
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { z } from 'zod';
22
33export const schema = z . object ( {
44 number : z . number ( ) . optional ( ) ,
5+ number2 : z . number ( ) . optional ( ) ,
56 date : z
67 . date ( )
78 . min ( new Date ( '2021-01-01' ) )
You can’t perform that action at this time.
0 commit comments