date,datepicker,windows-phone-8.1,format , Format date shown on DatePicker


Format date shown on DatePicker

Question:

Tag: date,datepicker,windows-phone-8.1,format

I created a Pivot Project on Visual Studio 2013.

I created the following control:

<DatePicker Header="Data" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,10,0,0" Width="341"/>

When I tap on it on my phone, it displays the date as M/D/Y. Is it possible to display it as D/M/Y?

Also, don't know if I should create another question, but how can I translate to pt-BR the day/month names shown within the control? As well as that "Choose a date".

enter image description here


Answer:

The DatePicker format is using user's preferred language and region. This control will automatically look different, for my region it's day/month/year like you wish it to be. I've tried to force the control to use other language, but it seems to be taking it directly from phone settings. Some information you may find here at MSDN:

If you need to allow users to choose a date or select a time, use the standard date and time picker controls. These will automatically use the date and time formats for the user's preferred language and region.

The other bad news you can find here at MSDN about formating that particular control:

Note This section applies to Windows Store apps using C++, C#, or Visual Basic. Formatting is ignored in Windows Phone Store apps.

So in current API it may be hard to change the formatting.

The good news is for the CHOOSE DATE text at the top - it's automatically localized, depending on user's language and region. So you don't have to worry about it if your app supports user's language. But I've not found way to change it to other text.

As for the text displayed inside the button before it's clicked, you can always use Button with DatePickerFlyout, a simple example with apropriate converter:

<Button Content="{Binding ElementName=chosenDate, Path=Date, Converter={StaticResource DateFormatConverter}}">
    <Button.Flyout>
        <DatePickerFlyout x:Name="chosenDate" />
    </Button.Flyout>
</Button>

and the converter class:

public class DateFormatConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, string language)
    {
        DateTimeOffset chosen = (DateTimeOffset)value;
        return string.Format("{0}/{1}/{2}", chosen.Day, chosen.Month, chosen.Year);
        // or use chosen.ToString() with format provider
    }

    public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); }
}

Related:


Create a variable Date in format “yyyy-mm-dd”


java,sqlite,date,jdbc
I am trying to insert to my table, a date in format "yyyy-mm-dd". My table has a field date type DATETIME and I use SQLite DB SYSTEM. I need to be in this format, so later to have the option to select dates from - then. My table: CREATE TABLE...

PHP Timezone not working correctly


php,date,time,timezone
So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this [SSCCE][1] code is not working. <?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br...

java.text.ParseException: Unparseable date: “01-02-2014”


java,date
I am newbie with servlet and jsp. I am trying to insert date into table with more information. This is my code try{ DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy",Locale.ENGLISH); Date reg=sdf.parse(request.getParameter("dob")); } catch(ParseException e) { e.printStackTrace(); } When I am debugging and control reaches to this line it throws an error...

How to validate an input date from individual day, month, year input in Laravel 5


php,date,laravel-5
I have a user registration form which takes input birth day split in 3 different input fields i.e. day, month, year {!! Form::selectMonth('month', null) !!} {!! Form::selectRange('day', 1, 31, null) !!} {!! Form::selectYear('year', Carbon\Carbon::now()->year, (new Carbon\Carbon('100 years ago'))->year, null) !!} In the backend I have modified the Registrar.php/validator() to check...

Format date (with different input) php


php,date,format,multilingual,jquery-validation-engine
I am working on a multilingual formular and have to solve a date formatting problem: In German the date format is: DD-MM-YYYY While in another country e.g. England the date format is: YYYY-MM-DD While this input validation is handled right, I need to get a easy solution for my php...

Get n data based on the same day (timestamp)


mysql,timestamp,date
I have this table "sensor" which has these fields : id (int,PK) timestamp (timestamp) latitude (varchar) longitude (varchar) data (float) As in one query I want to get 5 rows that were on the same day. Please note that it's not current date and the data has lots of different...

IE Input type Date not appearing as Date Picker


internet-explorer,date,datepicker
I am using the input type DATE in my HTML and everything works fine in Chrome and Firefox, but IE does not show the date picker. When I use the JQuery Datepicker I get two date picker dialogs in Chrome and Firefox. How can I fix this where I can...

PHP Checking if user is online


php,date,datetime,timestamp
I don't fully understand the PHP time functions, but I'm under the impression my function should work: function user_status($timestamp){ $online = date('Y-m-d H:i:s', strtotime('-5 minutes', strtotime(date('Y-m-d H:i:s')))); $away = date('Y-m-d H:i:s', strtotime('-15 minutes', strtotime(date('Y-m-d H:i:s')))); $offline = date('Y-m-d H:i:s', strtotime('-30 minutes', strtotime(date('Y-m-d H:i:s')))); if(strtotime($timestamp) >= $online){ return 'online'; } else...

Remove leading zeros from Oracle date


sql,oracle,date
I want to output the current date in the format: 1-1-2015 So without the zero's in this example: SELECT TO_CHAR(SYSDATE, 'DD-MM-YYYY') AS today FROM dual Output: 17-06-2015 ...

Capturing a value in a jQuery UI datepicker and alerting it back to the user


javascript,jquery,jquery-ui,datepicker
I need your help. How can some functionality be added onto the existing code below such that it will make the options below possible: If the date1 field is blank and the user selects a date, an alert message will popup and say "User has selected [date]" If the date1...

Teradata Convert DATE to midnight


date,time,teradata
below is the original code convert(datetime, (substring(convert(varchar(26), convert(datetime,getdate())),1,12) + '23:59:59:996')) output is = 6/17/2015 11:59:59.996 I converted it to Teradata below CAST(CURRENT_TIMESTAMP AS DATE FORMAT 'MM/DD/YYYY') || ' 23:59:59:999990' but upon compiling my store proc, it produces an error below Invalid or missing expression 'E(5404):Datetime field overflow.'. Is there a...

JSON Date Formatting


jquery,json,date
I'm having an issue with the date format when getting JSON Date/Time. I've managed to get the date format to: 2009-06-25T17:32:10.0000000 But I need to be: 25/06/2009 17:32:10 But since I'm getting this data from a loop I've trouble finding out how exactly to format the date so that the...

SQL Server / C# : Filter for System.Date - results only entries at 00:00:00


c#,asp.net,sql-server,date,gridview-sorting
I have a connected SQL Server database in Visual Studio and am displaying its content in a grid. I created a dropdown menu with the column names as selectable options and a text field to filter for specific content, e.g., DropDown = "Start" - Textfield = 14.03.2015 = Filter Column...

Using VLOOKUP formula or other function to compare two columns


mysql,excel,vba,date
I have one table like this: SHORT TERM BORROWING 1/6/2009 94304 12/31/2010 177823 6/30/2011 84188 12/31/2011 232144 6/30/2012 94467 9/30/2012 91445 12/31/2012 128523 3/31/2013 83731 6/30/2013 78330 9/30/2013 70936 12/31/2013 104020 3/31/2014 62345 6/30/2014 62167 9/30/2014 63494 12/31/2014 104239 3/31/2015 69056 I have another column which lists each date from...

Creating javascript dates object


javascript,date,object
I am trying to create an object with all the dates from "today" until 60 days from now. My code: var dates = []; getDateRange(); function getDateRange() { var today = new Date(); var date = new Date(); for (var i = 0; i <= 59; i++) { date.setDate(today.getDate()+i); console.log(date);...

AppleScript (or swift) add hours to time


swift,date,applescript
I'm trying to add 8Hours to a date (from the clipboard) set date1 to the clipboard set newdate to date1 + (8 * hours) display dialog "Purchases were downloaded at " & newdate buttons {"OK"} default button 1 But this is not working as expected, I'm having the error Can’t...

Convert string to ISODate in MongoDB


javascript,python,mongodb,date
I am new to MongoDB and I am stuck on the String to Date conversion. In the db the date item is stored in String type as "date":"2015-06-16T17:50:30.081Z" I want to group the docs by date and calculate the sum of each day so I have to extract year, month...

Spanish location for yii2-date-picker-widget


datepicker,yii2
I am working on the basic template of Yii2. I use the 2amigos yii2-date-picker-widget. Datepicker is working fine, but it keeps showing me the default language (that is English) instead of Spanish. As you can see in the code below, the language param is set to 'es': <?= $form->field($model, 'alta')->widget(...

Formatting dates in an MVC Dropdown


date,model-view-controller,html-select
I have a dropdown list on my page as so: - @Html.DropDownList("dd_dates", new SelectList(@Model.seasonDates), "Please Select") where seasonDates is an IList of dates. The problem is that when the dates are displayed in the dropdown they also have the time on them as well. How do I format the display...

quick way to add checkbox jQuery UI datepicker


jquery,jquery-ui,datepicker
I want to add the check box "no end date" to the end of my date picker widget. I see people using "beforeshow" method under datepicker but it doesn't seem to work. Here is what I have. $("#to").datepicker({ dayNamesMin: ["S", "M", "T", "W", "T", "F", "S"], firstDay: 1, dateFormat: "d...

Elasticsearch NumberFormatException when running two consecutive java tests


java,date,elasticsearch,numberformatexception,spring-data-elasticsearch
I have two test in a class, each of them containing the following query: SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery()).withFilter(rangeFilter("publishDate").lt(date)).build(); In one of the tests, the number of the results elasticsearchTemplate.count(searchQuery, Article.class), in the other one the returned values are verified elasticsearchTemplate.queryForPage(searchQuery,Article.class) If I run any of these two tests separately,...

How can I change the zIndex attribute of aui-datepicker in Liferay Portlet 6.2


datepicker,liferay,z-index,liferay-aui,alloy-ui
I have discoveder one problem with date field in portlet in LF 6.2. The problem is that after clicking on the input field, the datepicker is displaying, but with zIndex=0, that means it is under the portlet. If I change on firebug that parameter to 1, everything is OK. I...

Bootstrap 3 DatePicker - How to reset selected date without resetting the picker configuration?


jquery,twitter-bootstrap,datepicker
I'm trying to reset the selected date on button click, but so far I'm only able to clear the input element, without the actual date on the picker. The following code resets everything, including the configuration and the date, so its obviously not what I need. $('#datepicker').datepicker('update',''); //resets everything To...

Kendo Date to Date Time


html,css,angularjs,kendo-ui,datepicker
I am switching between a Kendo Date-Time picker and a Kendo Date Picker. The Picker alternates between the two depending on if the user has selected "All Day" - which then only the Date Picker is shown. However, when switching from the Date-Picker, to the Date-Time picker, if one alters...

Add days, weeks, months to date using jQuery


jquery,date
I have a form which lets the user select an invoice date and payment terms. The payment terms are; 1 week from invoice date, 4 weeks from invoice date, 1 month from invoice date, etc. When the user has selected an invoice date and the payment terms I then want...

Convert strings of data to “Data” objects in R [duplicate]


r,date,csv
This question already has an answer here: as.Date with dates in format m/d/y in R 2 answers My problem is that the as.Date function does not convert the values in a "date" column of a data frame into Date objects. I have a data.frame nmmaps. Here is a short...

reading OData date format in R


r,date,odata
I am reading a csv file exported from OData, and encounter a date format that looks like this: /Date(1391514600000)/. Any ideas on how to convert this into Date or POSIX in R?...

Get next month using mktime()


php,date,mktime
I'm trying to get the next month using PHP mktime() function. I am looking to get a result like 07/2015 but instead it is giving me 01/2015. Here is the code I am using: $next_month = strftime('%d/%Y', strtotime('+1 month', mktime(0,0,0,$month,1,$year))); The value of $month is 06. The value of $year...

need the way to put Date in Parse.com without Time and the opposite


android,date,time,parse.com
Can't figured how to put just Date or just Time to Parse.com. Even after SimpleDateFormat the Date objects transferring with full default missing data. Code samples: DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); DateFormat timeFormat = new SimpleDateFormat("HH:mm"); try { date = dateFormat.parse(mDate.getText().toString()); time = timeFormat.parse(mTime.getText().toString()); } catch (java.text.ParseException e) { ......

How to change date-time format?


sql-server,date,datetime,sql-server-2014
I have a RegDate column of nvarchar(max) type in my table in which dates are stored in mm/dd/yyyy (5/22/2015 11:09:39 PM) and dd-mm-yyyy (19-05-2015 22:55:05) format. I want to get all these entries in one format i.e. dd/mm/yyyy. I tried to convert it by using Convert(varchar(10),cast(vr.RegDate as DATETIME),105) as RegistrationDate...

validate jquery datepicker


jquery,html,jquery-ui,datepicker
i am looking for how to validate that user has selected a date or not. if he didn't selected a date form date picker he should be notified to select the date. i'm using jQuery datepicker. script i'm using is <script> $(function() { $( "#inputdate2" ).datepicker({ dateFormat: 'yy-mm-dd' }); });...

How to get dates between two dates


php,date
List of Dates between my From and Two <?php $scheduleStartDate = 2015-06-20; $scheduleEndDate = 2015-06-25; $Date = getDatesFromRange($scheduleStartDate,$scheduleEndDate); $Date = substr($Date, 0, -1); function getDatesFromRange($start, $end){ $dates = array($start); $Value = ''; while(end($dates) < $end) { $dates[] = date('Y-m-d', strtotime(end($dates).' +1 day')); $Value .= '"'.date('j-n-Y', strtotime(end($dates).' +1 day')).'",'; } return...

convert date format in php [duplicate]


php,mysql,date
This question already has an answer here: Convert one date format into another in PHP 9 answers Convert date format yyyy-mm-dd => dd-mm-yyyy 11 answers I would like to know how to convert 2015-06-15 to June 15, 2015 in PHP This is essentially the format that it is stored...

What are valid input DATE formats for the (Linux) date command?


linux,bash,date,scripting
The following command generates the date for the next day: date -d "20150615 12:00 +1 day" +%Y%m%d 20150616 I would like to specify my own INPUT date format, such as: 2015_06_15 But the date command does not like this format and complains about invalid date: date: invalid date '2015_06_15 12:00...

How to set current date with HTML input type Date Tag


php,html,date
I am new in php and i want to set current date in my HTMl date tag <input type="date" value="Today"> How i can get current date?...

Convert long int seconds to double precision floating-point value


c++,date,datetime,time,converter
I have a long int variable wich containes seconds since Jan. 1, 1970 in this format: long int seconds = 1231241242144214; i need to convert this seconds to double precision floating-point value. The integer part of the value is the number of days since midnight, 30 December 1899. The fractional...

How to find the days b/w two long date values


javascript,jquery,date
I have two long dates value. For Ex: 1433097000000 1434479400000 Here i have to find the days between these two by jquery For Ex: 15/06/2015 - 22/06/2015 If it is more than 5 days, I want to get from is 15/06/2016, to is 19/06/2015. It is based on long values...

Datepicker not showing days - Bootstrap


javascript,jquery,html,twitter-bootstrap,datepicker
I'm struggling with the answer to this, the reason I'm struggling is because the datepicker is working on one of my pages. Could an issue be that i'm loading a datatable at the same time as the datepicker? Because on the broken page, i'm loading the datatable which uses the...

Using date in CreateQueryDef


vba,date,ms-access
I have a table on which I run a query that I export to Excel. Here is an example: Table: Food Item | Price | Limit_Date | ------------------------------- Carrot | 0.80 | 08/07/2015 | Salmon | 4.30 | 01/07/2015 | Biscuits | 2.40 | 15/12/2015 | Milk | 1.00 |...

how to put datepicker in controller in yii


php,jquery,ajax,yii,datepicker
I have a form in yii and one field in form is come from controller by clicking on a button. if i pass text field instead of datepicker then it works otherwise it gives error so what to do now? my form code is as below: <div class="row buttonproduct" hidden>...

Date formatting - making dd/m/yyyy into dd/mm/yyyy


excel-vba,date,format
I got a pretty simple question (but yet I've been stuck at it for some time now). Does anyone know how to make the date value from dd/m/yyyy into dd/mm/yyyy in a variable? dim lastdaylastmonth as date lastdaylastmonth = DateSerial(Year(Date), Month(Date), 0) So this code, as of now, would return...

How do I change chromes Date-parsing / Sorting to match ff/ie Dateparsing?


javascript,jquery,google-chrome,date,momentjs
So I encounter a very weird problem here and am out of ideas at the moment. I've the following function to parse and sort a json object by its property RowDate, containing datestrings with the following format: "/Date(1389682861507+0100)/". orderByDate: function (json) { debug('[DataCollection::orderByDate], json before ordering: ', json); _.each(json.LineDefinitions, function...

python - how to check whether some given date exists in netcdf file


python,date,select,netcdf
I read my timesteps from a netcdf file: timesteps = ncfile.variables['time'] Now I would like to know whether some given date (say, June 23th) exists in that list. If it does, I want to omit it. The netcdf file contains arbitrary dates. I have no clue how to do this...

IBM Cognos _days_between function not working


mysql,database,date,cognos
I'm having an issue with Cognos 10. I'm trying to calculate the number of days between to dates so I use the _days_between( date1, date2 ) function. _days_between ([Derniere Date Changement diaphragme] , [Premiere Date Changement diaphragme]) I'm quite sure the two Dates are Date objects ( I set them...

create jquery array for ajax post


javascript,jquery,ajax,datepicker
How can I convert the output of drp.getDateRange to an array so that I can post it via AJAX? I have updated this code to represent the advice given below <script> var drp; var myArray = []; function makedatepicker() { drp = $("#myDate").datepicker({}); } function getRange() { var data =...

Count Down 1 Day for Each Row mysql


mysql,date
I added a column to my mysql table called dateAdded which should hold a time value for each row. I want to add a time value into each row in the column, but I want it to count down by one day. I used: UPDATE products set dateAdded=DATE_ADD('2015-06-15 11:31:31', INTERVAL...

Select before specific date from one day only


mysql,sql,date
I need to retrieve data from MySQL from one day, but I don't know the interval between two rows (there may be 4 rows from one day and a gap of a week for example). Let's say I have: (following isn't code) 3 rows where date = 2015-06-15 1 row...

Android - At Minutes to a Time hh.mm.ss


java,android,date,time
i,ve got a problem which i cant solve at the moment. I already googled for it and found some solutions, but all of them not rly match my problem. So i get 2 Strings from SQL Database in the format hh:mm:ss. The first String is a time, for example "14:30:00"...

Convert March 2015 to 03/2015 and make into date


mysql,date
I have a column which holds values in the format 'June 2015', 'July 2015', 'March 2014', 'February 2016'. I need to convert these into the format 06/2015, 07/2015, 03/2014, 02/2016.. but also make them a date so I can sort by this column. I currently have the following select: SELECT...