Giter Club home page Giter Club logo

egui-datepicker's Introduction

egui-datepicker

Latest version

This library provide a simple date picker widget for egui with some customization. Checkout the gif to see widget in action!

⚡️ Quickstart

Add egui-datepicker as dependency to your project

[dependencies]
egui-datepicker = "0.3"

Import necessary structs

use egui_datepicker::{DatePicker, Date, Utc};

or if you already include chrono in your project

use egui_datepicker::DatePicker;
use chrono::{Date, offset::Utc};

Add date field with selected time offset in app struct

struct MyApp {
    date: Date<Utc>,
}

Add widget in update function

fn update(/*snip*/) {
    /*snip*/
    ui.add(DatePicker::new("datepicker-unique-id", &mut self.date));
    /*snip*/
}

👀 Customization

You can set first day of week to sunday with

DatePicker::new(/*snip*/).sunday_first(true)

Make popup window movable

DatePicker::new(/*snip*/).movable(true)

Set different date format

DatePicker::new(/*snip*/).date_format("%d/%m/%Y")

⚠️ License

egui-datepicker is licensed under MIT OR Apache-2.0

egui-datepicker's People

Contributors

shadr avatar zeskeertwee avatar wfraser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.