Skip to content

Commit

Permalink
remember selected date
Browse files Browse the repository at this point in the history
  • Loading branch information
arrufat committed May 27, 2017
1 parent 3efd645 commit 1b279ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ public class Pdftag : ApplicationWindow {
private void on_date_clicked (Button btn) {
var popover = new Popover (btn);
var calendar = new Calendar ();
var date_parse = btn.label.split ("-", 3);
calendar.select_month (int.parse (date_parse[1]) - 1, int.parse (date_parse[0]));
calendar.select_day (int.parse (date_parse[2]));
popover.add (calendar);
calendar.day_selected.connect (() => {
var date = "%04d-%02d-%02d".printf (calendar.year, calendar.month + 1, calendar.day);
Expand Down

0 comments on commit 1b279ae

Please sign in to comment.