Giter VIP home page Giter VIP logo

danielhanold.pickerwidget's People

Contributors

apzentral avatar danielhanold avatar rebelinblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

danielhanold.pickerwidget's Issues

minDate on Android doesn't do anything

So on Android does not support Ti.UI.PICKER_TYPE_DATE_AND_TIME, therefore only Ti.UI.PICKER_TYPE_DATE can be used. However, the minDate is not taking effect.

Open event

Hi,

How can I add open the picker when I click in a text field for example ?

Tks,

JSON array not working on pickerValues

Hi,

Im working with alloy and while fetching a collection, the data of the response is a JSON Array. This is not working because the data expected is:

[{10: 'Auburn', 20: 'Bald', 30: 'Black', 40: 'Blond', 50: 'Brown'}],

Ideas?

cancel button throws error; minDate fails

Daniel,
Great job on the widget. Works beautifully except for the cancel button and the minDate assignment. Very possible I'm doing something wrong.

First, the cancel button:
When selecting it, I get an error.

[ERROR] :      message = "'null' is not an object (evaluating 'e.data.date')";

(e.data.date is defined in the onDone callback)
At first, I thought this occurred when I simply opened and closed the picker without selecting a value. Not true. The error occurred regardless.

Next is the minDate variable. I use moment.js to calculate the value

    var minDate = moment().subtract('years', 2);

which returns the correct value

[INFO] :   [balances] minDate = "2012-08-15T16:18:59.332Z"

I have minDate defined in pickerParams:

        pickerParams : {
            minDate : minDate,
            maxDate : maxDate,
            value : defaultDate,
            maxSelectedDate : maxSelectedDate,
            maxSelectedDateErrorMessage : 'Cannot select future dates.'
        },

However, the user is able to select a date older than the minimum. I am expecting minDate to disallow selections older than this date, which is the converse of maxDate where the user cannot select any date forward of 'maxDate`.

I would appreciate your assistance on how to resolve these issues. Thanks.

[UIPickerView setDatePickerMode:]: unrecognized selector sent to instance 0x7fb0ef642210";

Using:

  • danielhanold.pickerwidget: version 1.1 from this GitHub Repo
  • Appcelerator Studio: build: 4.6.0.201605201934,
  • moment.js version 2.0.0
  • SDK: 6.0.1 GA
  • iPad, iPhone, Android,
  • Currently testing on iPhone5S real device and simulator for the latest iOS 10.

The code below:

$.picker.blur();
// Date Picker example.
// Set minimum date to 1900.
var minDate = new Date(new Date().setYear(1900));
// Set minimum date to today
var maxDate = new Date();
  
// Will load the last value
var _pickerValue = $.picker.getValue();
console.log('[*] Current Birth Date.');
console.log(_pickerValue);
var defaultValue = (_pickerValue) ? moment(_pickerValue, 'M/D/YYYY').toDate() : maxDate;
var maxSelectedDate = new Date();
var overlay = Alloy.createWidget('danielhanold.pickerWidget', {
    id: 'myDatePicker',
    outerView: $.mainWindow,
    hideNavBar: false,
    type: 'date-picker',
    pickerParams: {
      minDate: minDate,
      maxDate: maxDate,
      value: defaultValue,
      maxSelectedDate: maxSelectedDate,
      maxSelectedDateErrorMessage: 'The Person must be Born First!'
    },
    onDone: function(e) {
      var _date = (e.data && e.data.unixMilliseconds) ? e.data.unixMilliseconds : null;
      if (!_date) {
        $.picker.setValue('');
        return;
      }
      picker_date = moment(_date).format('l');
      $.picker.setValue(picker_date);
    },
  });

simulator screen shot feb 2 2017 3 42 43 pm

Get text or value

i m trying to use this by clicking on label and setting the selected value as text on the label....can you plz tell me how to get text of the selected value...

Date picker randomly crashing on iOS

If I use the date picker, including the example code randomly when activating it on iOS I get the following

  [ERROR] Script Error {
  [ERROR]     backtrace = "#0 Controller() at file:///Users/stephen/Library/Developer/CoreSimulator/Devices/C248FB08-0174-49E1-9DFF-4292F6CF857C/data/Containers/Bundle/Application/DA3E6DB4-6F4F-40BD-97A2-C307F8CE5C52/La%20Tasca.app/alloy/widgets/danielhanold.pickerWidget/controllers/widget.js:236\n#1 () at file:///Users/stephen/Library/Developer/CoreSimulator/Devices/C248FB08-0174-49E1-9DFF-4292F6CF857C/data/Containers/Bundle/Application/DA3E6DB4-6F4F-40BD-97A2-C307F8CE5C52/La%20Tasca.app/alloy.js:260\n#2 () at file:///Users/stephen/Library/Developer/CoreSimulator/Devices/C248FB08-0174-49E1-9DFF-4292F6CF857C/data/Containers/Bundle/Application/DA3E6DB4-6F4F-40BD-97A2-C307F8CE5C52/La%20Tasca.app/alloy/controllers/register.js:328";
  [ERROR]     line = 78;
  [ERROR]     message = "-[UIPickerView setDatePickerMode:]: unrecognized selector sent to instance 0x797ceba0";
  [ERROR]     sourceId = 325739168;
  [ERROR]     sourceURL = "file:///Users/stephen/Library/Developer/CoreSimulator/Devices/C248FB08-0174-49E1-9DFF-4292F6CF857C/data/Containers/Bundle/Application/DA3E6DB4-6F4F-40BD-97A2-C307F8CE5C52/La%20Tasca.app/alloy/widgets/danielhanold.pickerWidget/controllers/widget.js";
  [ERROR] }

Which appears to be this line

  picker.setType(Ti.UI.PICKER_TYPE_DATE);

However, I have noticed that if I change line 7 of pickerView.js from

  if (args.type === 'date-picker' && OS_ANDROID)

to

  if (args.type === 'date-picker')

It works fine.

This has been happening on both iOS 8 and 8.1

I have uploaded a video showing this behaviour https://dl.dropboxusercontent.com/u/239816/Untitled.m4v

It is just a view with a label with an onClick button

https://gist.github.com/REBELinBLUE/2d4cf750bd01b78e1d1c

Cancel button not working

in case >>> type : 'date-picker'
when click on cancel it will apear this message ([ERROR] message = "null is not an object ")

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.