Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 2D Blocks
  4. Date Picker Widget

Date Picker Widget

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 728 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

    Introduction

    In some apps, the user needs to specify a date. For example, to make a reservation on a day, or add an event to a calendar on a day. You can use the date picker widget to allow the user to pick a date, instead of typing it.

     
     

    Add a Date Picker

    You can use the following block to add a date picker widget centered at the given x/y position:

    03955c3a-a93d-4868-85cd-b68380de5e90-image.png

     
    It will start with a default value of today’s date, and you can pick any other date:

    dp.gif

     
     

    Handle Date Selection

    When the user has chosen a new date, you can use the “when widget changes” hat-block to handle this event. The updated date value will be stored in the “value of widget” block. For example, we can make the sprite say the newly selected date using these 2 blocks:

    dp2.gif

     
     

    Setting a Date Value

    If you do not want the initial date to be today’s value, you can change it using the “set value to” block:

    dp3.gif

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode