PDA

View Full Version : Ext.PDate [4] (Extjs persian date) with date picker and date field



vahid4134
28 Jul 2011, 8:27 AM
Hy
I create Ext.PDate with date picker and date field for persian date in Ext 4.
this is good example for full support I18n in date


Update 30 Nov 2011

update for Ext 4.0.7 and fix some bug. now in github

https://github.com/vahid-sohrabloo/Ext.Pdate

mitchellsimoens
28 Jul 2011, 12:34 PM
Was hoping for a screenshot and/or online demo :)

vahid4134
29 Jul 2011, 12:05 AM
for more information about perian date
http://en.wikipedia.org/wiki/Iranian_calendars

2720427205

salarmehr
7 Aug 2011, 12:32 AM
Could you extend date picker and just add to in a config like 'calType="jalali" ' to change calander type?

vahid4134
7 Aug 2011, 10:23 AM
Why?
you can use xtype or widget .

hamintori
22 Aug 2011, 11:18 PM
salam vahid jan
mishe begi chetori az in taghvimet too braname estefade konim
ye code nemoone nadari bezari:-?
man too .net mikham azash estefade konam
damet garm

vahid4134
23 Aug 2011, 9:34 AM
Hi
this doc
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.Date
only use Ext.form.field.PDate instance of Ext.form.field.Date

hamintori
23 Aug 2011, 10:48 AM
Thanks for reply mr vahid
man az ext.net estefade mikonam
age mishe ye code sample bara datefield bezari mamnoonet misham
man har kari kardam nashod error midad
tashakor/:)/:)

vahid4134
23 Aug 2011, 8:31 PM
I dont know any thing about Ext.net. sorry

hamintori
23 Aug 2011, 9:19 PM
thanks mr vahid
ye sample code az persian date darid ke man bebinam chetori kar mikone:-/
age darid bezarid
Tankiooo

labafian
10 Jan 2012, 10:41 PM
Hy
I create Ext.PDate with date picker and date field for persian date in Ext 4.
this is good example for full support I18n in date


Update 30 Nov 2011

update for Ext 4.0.7 and fix some bug. now in github

https://github.com/vahid-sohrabloo/Ext.Pdate

Hey Vahid
thanks for creat persian date, but can i use this file (pdate.js) for gantt chart component vaer 1.2.2 extjs ??
thanks for answer my question
regard, mojtaba

vahid4134
11 Jan 2012, 12:37 AM
Hi mojtaba .
Yes You can use this for any component that use Ext.Date. But you must change code for compatibily.
I use Ext.PDate for Extensible 1.5 . but change some code for compatibility with pdate

masoud_tamizy
4 Feb 2012, 7:44 AM
why does it returns date , like "2000-01-05" in datefield ?
i need persian date !!!

vahid4134
4 Feb 2012, 8:14 AM
Hi
please give me source code

masoud_tamizy
4 Feb 2012, 8:21 AM
Hi
please give me source code
hi , this is a row of a grid(row-edit) :


{ dataIndex:'birth_date',
text:'تاريخ تولذ',
width: 75,
align:'right',
hidden:true,
renderer : Ext.util.Format.dateRenderer('Y/m/d'),
editor: {xtype:'pdatefield' ,format: 'Y/m/d' ,allowBlank: true ,selectOnFocus:true ,maxLength:10 ,enforceMaxLength:true ,maxValue: new Date()}

vahid4134
4 Feb 2012, 10:40 AM
You use Ext.util.Format.dateRenderer('Y/m/d') and this not retun Persian date. you can user custom renderer function and on this function use Ext.PDate.format

masoud_tamizy
4 Feb 2012, 11:23 AM
i don't know how can i implement a custom datarenderer . i'm begineer in EXt ! if you can , plz help me :)

vahid4134
4 Feb 2012, 12:39 PM
Like this


{ dataIndex:'birth_date',
text:'تاريخ تولذ',
width: 75,
align:'right',
hidden:true,
renderer : function(v)
{
return Ext.PDate.format("Y/m/d",v);
},
editor: {xtype:'pdatefield' ,format: 'Y/m/d' ,allowBlank: true ,selectOnFocus:true ,maxLength:10 ,enforceMaxLength:true ,maxValue: new Date()}


Sorry I dont test this code

masoud_tamizy
4 Feb 2012, 9:50 PM
thanks , but i test it and didn't work ! i don't know how can i do it , if you can help me

vahid4134
4 Feb 2012, 11:19 PM
{ dataIndex:'birth_date',
text:'تاريخ تولذ',
width: 75,
align:'right',
hidden:true,
renderer : function(v)
{
if(v && Ext.isDate(v)){
return Ext.PDate.format(v, "Y/m/d");
}
return v;
},
editor: {xtype:'pdatefield' ,format: 'Y/m/d' ,allowBlank: true ,selectOnFocus:true ,maxLength:10 ,enforceMaxLength:true ,maxValue: new Date()}

masoud_tamizy
4 Feb 2012, 11:57 PM
thanks vahid , it works correctly :)
can you explain me (more) how it works ?

vahid4134
5 Feb 2012, 9:18 AM
Full information about
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Column-cfg-renderer

nimaous
23 Jun 2012, 4:04 AM
Hi vahid

How I can use your package .. where should I locate your package and How can I use it in gridpanle date columns editor

nimaous
23 Jun 2012, 4:13 AM
Hi vahid

How I can use your package .. where should I locate your package and How can I use it in gridpanle date columns editor

vahid4134
24 Jun 2012, 12:49 AM
Just include All files and then use
Ext.form.field.PDate like Ext.form.field.Date

nimaous
24 Jun 2012, 4:06 AM
vahid I want to use it in e grid panel column editor .
I cant make any instance of pdate
is there any method to use your pdate form field as xtype ?

vahid4134
25 Jun 2012, 9:52 AM
you can use pdatefield xtype for Persian date field

nimaous
25 Jun 2012, 10:55 AM
tnx alot

labafian
19 Jul 2012, 1:32 AM
hi vahid ,
i found bug in this package,
i'm using gantt chart ver 2.0.x and in my grid definded two column for StarDate and EndDate,
so both of set xtype pdatefield , when clicked on StartDate column show me datepicker great but next click on EndDate column and show me

37314

what's wrong??
thanks

vahid4134
19 Jul 2012, 1:49 AM
Hi labafian
please test with the Main Date picker (Ext.form.field.Date) and report to me

labafian
19 Jul 2012, 3:47 AM
tested, Ext.form.field.Date working great!

mehdiemrani
14 Aug 2012, 8:18 PM
hi, you did a great job, but can you leave a sample here or in github please. thanks.

vahid4134
14 Aug 2012, 10:29 PM
Ok . I upload new example.
But use this component is very simple and like default DatePicker. Just import js files (Please be careful the order them) and Use Ext.form.field.PDatefield like Ext.form.field.Datefield

mehdiemrani
15 Aug 2012, 2:31 AM
I use PDate with ext-4.0.7-gpl/ext-all.js version and every things is OK and really it's great,
but when i want to use ext-4.1.0-gpl/ext-all.js or ext-4.1.0-gpl/ext-all-debug.js I got this error: me.eventEl is null.






onRender : function(container, position){
var me = this;
debugger;
me.callParent(arguments);
me.el.unselectable();
me.cells = me.eventEl.select('tbody td');
me.textNodes = me.eventEl.query('tbody td span');
},

me.callParent function set me.eventEl as null !!!






Solved:
I made some changes in your codes and now it's work on version 4.1
thanks again for your nice job, good luck.

fshnet
9 Oct 2012, 3:01 AM
I use PDate with ext-4.0.7-gpl/ext-all.js version and every things is OK and really it's great,
but when i want to use ext-4.1.0-gpl/ext-all.js or ext-4.1.0-gpl/ext-all-debug.js I got this error: me.eventEl is null.






onRender : function(container, position){
var me = this;
debugger;
me.callParent(arguments);
me.el.unselectable();
me.cells = me.eventEl.select('tbody td');
me.textNodes = me.eventEl.query('tbody td span');
},

me.callParent function set me.eventEl as null !!!






Solved:
I made some changes in your codes and now it's work on version 4.1
thanks again for your nice job, good luck.

What exactly did you change?
I'm facing the exact same problem right now.

vahid4134
9 Oct 2012, 11:40 PM
I update repository to support Ext 4.1.1
https://github.com/vahid-sohrabloo/Ext.Pdate/

fshnet
13 Oct 2012, 4:33 AM
Thanks Vahid
your update works perfectly except whenever i try month view this error occurs

Ext.picker.PMonth( is not a constructor

Looking at your code i figured out you're missing a requires section like this


requires: ['Ext.picker.PMonth']
adding that line to picker/PDate.js fixed the problem

vahid4134
13 Oct 2012, 9:39 PM
Thanks Update

hossein1364
9 Mar 2013, 3:18 AM
download attachment and enjoy~o)B)